package com.niu.service.impl;

import com.niu.mapper.DeptLogMapper;
import com.niu.pojo.DeptLog;
import com.niu.service.DeptLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author 鹅鹅鹅
 * @Version 1.0.0
 * @Date 2025/7/19 10:53
 * @Description
 */
@Service
public class DeptLogServiceImpl implements DeptLogService {

    @Autowired
    private DeptLogMapper deptLogMapper;

    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW) // 独立创建事务
    public void insertLog(DeptLog log) {
        deptLogMapper.insertLog(log);
    }
}
